package com.xcity.game.buff.effect;

import com.xcity.db.entity.Player;
import com.xcity.game.buff.Buff;
import com.xcity.game.buff.BuffEffector;
import com.xcity.game.common.PlayerPool;
import com.xcity.pomelo.push.SyncPush;
import com.xcity.pomelo.push.sync.ByteSync;

/**
 * 看门狗buff效果
 * @author yang.li
 *
 */
@Deprecated
public class WatchdogEffect implements BuffEffector {

	@Override
	public boolean effect(Buff buff, Player player) {
		player.poolSet(PlayerPool.PROPERTY_BUFF_WATCHDOG, buff.getId());
		player.send(new ByteSync(SyncPush.SYNC_WATCHDOG, (byte) buff.getId()));
		return true;
	}

	@Override
	public boolean uneffect(Buff buff, Player player) {
		player.poolRemove(PlayerPool.PROPERTY_BUFF_WATCHDOG);
		player.send(new ByteSync(SyncPush.SYNC_WATCHDOG, (byte) 0));
		return true;
	}

}
